RA -*- mode: org; -*-

help: [C-uc .] insert timestamp [C-cc] flip checkbox [C-uucc] partial flip [M-RET] continue list
checkbox [C-ct] flip TODO

#+STARTUP: logdone

* TODO [1/6]
  - [-] Bugs [1/7]
    - [ ] ra::Small<real, 3, 3, 3>() benchmark in bench-dot.cc has op 10x worse
      than indexed
      - Tried is_constant_eval in c++20 but didn't work out as I hoped.
    - [X] size_s, rank_s in Ryn:: are broken [ra07]
    - [ ] ambiguity / bad init in nested constructors [ra45]
    - [ ] subscripting inconsistencies; for example, if `A` is rank>1 and `i` is
      rank 1, then `A(i)` will return a nested expression instead of preserving
      `A`'s rank.
    - [ ] beatable subscripts are not beaten if mixed with non-beatable
      subscripts. E.g. in A(vector, iota, vector) the iota isn't beaten.
    - [ ] be namespace clean except for possibly real.hh, complex.hh.
    - [ ] make iter work with w/rank.
  - [-] Features [1/5]
    - [ ] Iota is both vector-like object and iterator. Split into two types?
    - [ ] View::p is not const because it's used as sliding window (cell_iterator). Split into two types?
    - [ ] Should be able to reshape iota (??) or show examples with TensorIndex,
      maybe. One idea is to generalize View (so View<Iota>, etc.) which is
      something that newra does. But as long as Container is parent of View,
      conversion of (Container const &) into (View const &) forces us to have
      const/nonconst overloads in View (instead of just relying on the constness
      of (View::p). This is just a mess when View::p isn't a pointer.
      - [ ] Fix relationship between Container and View [0/5]
        - [ ] forward const/nonconst overloads to View or ViewConst from here.
        - [ ] remove inheritance relationship of Container on View
        - [ ] add const/nonconst casts of Container to View or ViewConst
        - [ ] remove const overloads from View::operator()
        - [ ] make View be View<pointer> and not View<value_type>
    - [ ] Should be able to turn ravel iterators (e.g. View::begin()) into array
      iterators. Ptr() doesn't work for that. Or to obtain STLIterator from any
      array iterator. That may come of merging STLIterator with
      ply_index/ply_ravel.
    - [ ] gemv(conj(a), b) should work. Beat View-like selectors down an Expr??
    - [ ] port some of the View ops to generic ArrayIterator. reverse,
          transpose, etc. seem easy enough. Only it kind of bothers me that they
          need their own Expr-like types while on Views it's just a one time
          op. Propagating ops down Expr into leaf Views (a kind of beating) would be
          better.
    - [X] Support operator <=> <2020-09-15 Tue 13:50>
      - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96278 is annoying
  - [X] Error report, debugging [3/3]
    - [X] Optionally throw instead of abort on bounds checks, etc. cf. test/check-runtime.cc
      * This was fixed between v8 and v10, see examples/throw.cc.
    - [X] Static check on Small constructors e.g. real3 {1, 2, 3}. Cf big.hh:513 init<SS>(SS const & s).
      - [X] for Container constructors
      - [X] for Small constructors
    - [X] General static check on prefix matching <2019-02-06 Wed 12:06>
  - [-] Building, tests [3/5]
    - [X] Build docs with cmake
    - [X] Support RA_USE_BLAS with cmake (linux)
    - [X] Support RA_USE_BLAS with cmake (mac) <2018-12-07 Fri 16:33>
    - [ ] Make cmake tests respect dependences and able to be run independently.
    - [ ] Test for expected compilation errors (static_assert, etc) [ra42].
  - [ ] Documentation [0/3]
    - [ ] Complete section on internals
    - [ ] Complete section on other languages, libraries
    - [ ] Describe xreferenced issues in doc ([raxx], etc.)
  - [ ] Other [0/1]
    - [ ] Support tuple as a kind of foreign vector
      - [ ] Iterator type for tuple (like Vector for std::vector).
      - [ ] Appropriate ply. Possibly restrict it to rank 1.

Will stop reusing issue numbers so I can keep the record. Some of these aren't bugs in the sense that I expect to solve them, but more like footnotes.

* Numbered issues throughout the source [ra...]
  1. [ ]
  2. [ ]
  3. [ ]
  4. [ ] test/optimize.cc
     Expression objects only keep pointers to data objects. This means that it is unsafe to define expression objects unless none of the data objects are temporaries. E.g. `auto e = temp + temp;` is unsafe. Either `obj a; obj b; auto e = a + b;` or `obj o = temp + temp;` is safe. Generally there's no reason to ever define expression objects explicitly.
  5. [ ]
  6. [ ]
  7. [ ]
  8. [ ]
  9. [ ] test/ra-6.cc
     Using the same lvalue ra::vector multiple times in an expression is broken, since start(ra::Vector) doesn't restart, so they clash with each other in ply. See also [ra39].
     The reason start(ra::Vector) doesn't restart is that ra::Vector may contain a copy of v instead of a reference, same as ra::Scalar. But this is problematic since plying modifies the RaIterator. So I should split ra::Vector into the Array-like owning object and the RaIterator object which is exclusively a temp and can be made to hold a ref.
  10. [ ] test/ra-0.cc
     size(SmallArray) requires ra:: to avoid collision with std::size, but not size(Big) (??).
  11. [ ]
  12. [ ]
  13. [ ]
  14. [ ]
  15. [ ]
  16. [ ]
  17. [ ]
  18. [ ] ra/big.hh, test/big-1.cc
      Conversions from View<non-const P> to View<P> of the same rank. Cf [ra29].
  19. [ ] ra/big.hh, ra/small.hh
      FIXME
      It's inconsistent that View argument is a pointer type while SmallView's is not.
  20. [ ]
  21. [ ]
  22. [ ]
  23. [ ]
  24. [ ]
  25. [ ]
  26. [ ]
  27. [ ] ra/big.hh, ra/bootstrap.hh
      FIXME
      P is constrained to std::random_access_iterator but eventually should allow at least Iota.
  28. [ ] test/big-1.cc
      FIXME
      A constructor function make_view should be available to deduce P of the result View<P>.
  29. [ ] ra/big.hh, test/big-1.cc
      Conversions from View<non-const P> to View<P> with different rank class (fixed to var). Cf [ra18].
  30. [ ]
  31. [ ]
  32. [ ]
  33. [ ]
  34. [ ]
  35. [ ]
  36. [ ]
  37. [ ]
  38. [ ]
  39. [ ] test/ra-7.cc
      There's no reason to restart, since the RaIterator methods are all static. So start(ra::Scalar) just forwards. But that means that Scalar::c maintain constness, so a const overload is required for ScalarFlat::operator*.
  40. [ ]
  41. [ ]
  42. [ ]
  43. [ ] bench/bench-dot.cc
      The performace of f_small_op depends on the optimization in plyf() through ocd<>(). Doing this required having static and non-static versions of RaIterator::keep_stride in Match/Expr. Possibly the same could be done to reduce rank/rank_s, size/size_s to just rank/size, and check for static-ness instead of RANK_ANY/DIM_ANY.
  44. [ ]
  45. [ ]
  46. [ ]
  47. [ ] ra/big.hh, test/const.cc, ra/view-ops.hh ...
      FIXME
      In the viewp branch View doesn't have any const-dependent members anymore. Constness depends instead on the constness of View::p. However this means that the const transfer has to be implemented in Container now, and that Container cannot be public-derived from View. This requires a fair amount of patching/refactoring still TBD.
      In the view2 branch however View retains its const-dependent members. The inconsistency that data() isn't const dependent remains, but then it's impossible to differentiate between const-contents and const-view for View<> const, fixing that breaks any of the functions taking View const & for the view only, which should be transparent to the contents (transpose, reverse, etc).
